import Taro, { Component } from '@tarojs/taro'
import { ScrollView, View } from '@tarojs/components'
import serviceApi from './../../service/api'
import './hot-service-summary.scss'
export class HotServiceSummary extends Component {

  remarkClick(menu_id, e){
      Taro.navigateTo({
      url: '/pages/detail/index?menu_id='+menu_id
    })
  }

  render() {
    const content = this.props.summary.map((s) => {
    return <View>
        {s.type === 1 && <Image src={s.content} className="hotservice-image jianju" onClick={this.remarkClick.bind(this, s.menu_id)} />}
        {!s.type && <Text className="jianju">{s.content}</Text>}
        </View>
    })

    return (
       this.props.summary.length > 0 && <View className="intro jianju zicolor">{content}</View>
    )
  }
}